.class public abstract Lcom/ninesky/a/a/d;
.super Ljava/lang/Object;


# static fields
.field private static final a:Z


# instance fields
.field private b:Lorg/json/JSONObject;

.field private c:Lcom/ninesky/a/a/b;

.field private d:Ljava/lang/String;

.field private e:Ljava/lang/String;

.field private f:Ljava/lang/String;

.field private g:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    sget-boolean v0, Lcom/ninesky/a/a/f;->b:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    sput-boolean v0, Lcom/ninesky/a/a/d;->a:Z

    return-void

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .locals 3

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Lcom/ninesky/a/a/b;

    invoke-direct {v0, p1, p2}, Lcom/ninesky/a/a/b;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v0, p0, Lcom/ninesky/a/a/d;->c:Lcom/ninesky/a/a/b;

    :try_start_0
    invoke-virtual {p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v0

    const-string v1, "com.ninesky.browser"

    const/16 v2, 0x80

    invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;

    move-result-object v0

    iget-object v1, v0, Landroid/content/pm/ApplicationInfo;->metaData:Landroid/os/Bundle;

    const-string v2, "PRODUCT_CHANNEL"

    invoke-virtual {v1, v2}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/ninesky/a/a/d;->d:Ljava/lang/String;

    iget-object v0, v0, Landroid/content/pm/ApplicationInfo;->metaData:Landroid/os/Bundle;

    const-string v1, "CLOUD_PROTOCOL_VERSION"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getFloat(Ljava/lang/String;)F

    move-result v0

    invoke-static {v0}, Ljava/lang/String;->valueOf(F)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/a/a/d;->e:Ljava/lang/String;

    sget-boolean v0, Lcom/ninesky/a/a/d;->a:Z

    if-eqz v0, :cond_0

    const-string v0, "BaseRequest"

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "mStrChannel="

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v2, p0, Lcom/ninesky/a/a/d;->d:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    const-string v0, "BaseRequest"

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "mStrApiLevel="

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v2, p0, Lcom/ninesky/a/a/d;->e:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_0
    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Landroid/content/pm/PackageManager$NameNotFoundException;->printStackTrace()V

    goto :goto_0
.end method

.method public static f()Z
    .locals 1

    sget-boolean v0, Lcom/ninesky/a/a/f;->c:Z

    return v0
.end method


# virtual methods
.method protected abstract a()Ljava/lang/String;
.end method

.method public final a(Lcom/ninesky/a/a/a;)V
    .locals 1

    iget-object v0, p0, Lcom/ninesky/a/a/d;->c:Lcom/ninesky/a/a/b;

    invoke-virtual {v0, p1}, Lcom/ninesky/a/a/b;->a(Lcom/ninesky/a/a/a;)V

    return-void
.end method

.method public final b(Ljava/lang/String;)V
    .locals 0

    iput-object p1, p0, Lcom/ninesky/a/a/d;->f:Ljava/lang/String;

    return-void
.end method

.method protected abstract c()Lorg/json/JSONObject;
.end method

.method public abstract d()Lcom/ninesky/a/a/e;
.end method

.method public final g()Lorg/json/JSONObject;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/a/a/d;->b:Lorg/json/JSONObject;

    return-object v0
.end method

.method public final h()V
    .locals 3

    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    iput-object v0, p0, Lcom/ninesky/a/a/d;->b:Lorg/json/JSONObject;

    :try_start_0
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    iget-object v1, p0, Lcom/ninesky/a/a/d;->e:Ljava/lang/String;

    if-eqz v1, :cond_0

    const-string v1, "apilevel"

    iget-object v2, p0, Lcom/ninesky/a/a/d;->e:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    :cond_0
    iget-object v1, p0, Lcom/ninesky/a/a/d;->d:Ljava/lang/String;

    if-eqz v1, :cond_1

    const-string v1, "channel"

    iget-object v2, p0, Lcom/ninesky/a/a/d;->d:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    :cond_1
    iget-object v1, p0, Lcom/ninesky/a/a/d;->f:Ljava/lang/String;

    if-eqz v1, :cond_2

    const-string v1, "sid"

    iget-object v2, p0, Lcom/ninesky/a/a/d;->f:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    :cond_2
    const-string v1, "locale"

    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v2

    invoke-virtual {v2}, Ljava/util/Locale;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    iget-object v1, p0, Lcom/ninesky/a/a/d;->b:Lorg/json/JSONObject;

    const-string v2, "head"

    invoke-virtual {v1, v2, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    iget-object v1, p0, Lcom/ninesky/a/a/d;->g:Ljava/lang/String;

    if-eqz v1, :cond_3

    const-string v1, "sn"

    iget-object v2, p0, Lcom/ninesky/a/a/d;->g:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    :cond_3
    invoke-virtual {p0}, Lcom/ninesky/a/a/d;->a()Ljava/lang/String;

    move-result-object v1

    if-eqz v1, :cond_4

    const-string v2, "command"

    invoke-virtual {v0, v2, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    :cond_4
    invoke-virtual {p0}, Lcom/ninesky/a/a/d;->c()Lorg/json/JSONObject;

    move-result-object v1

    if-eqz v1, :cond_5

    const-string v2, "data"

    invoke-virtual {v0, v2, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    :cond_5
    iget-object v1, p0, Lcom/ninesky/a/a/d;->b:Lorg/json/JSONObject;

    const-string v2, "cmd"

    invoke-virtual {v1, v2, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_6
    :goto_0
    sget-boolean v0, Lcom/ninesky/a/a/d;->a:Z

    if-eqz v0, :cond_7

    const-string v0, "BaseRequest"

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "mRequestProto="

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v2, p0, Lcom/ninesky/a/a/d;->b:Lorg/json/JSONObject;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_7
    iget-object v0, p0, Lcom/ninesky/a/a/d;->c:Lcom/ninesky/a/a/b;

    invoke-virtual {p0}, Lcom/ninesky/a/a/d;->d()Lcom/ninesky/a/a/e;

    move-result-object v1

    invoke-virtual {v0, p0, v1}, Lcom/ninesky/a/a/b;->a(Lcom/ninesky/a/a/d;Lcom/ninesky/a/a/e;)V

    return-void

    :catch_0
    move-exception v0

    sget-boolean v1, Lcom/ninesky/a/a/d;->a:Z

    if-eqz v1, :cond_6

    const-string v1, "BaseRequest"

    invoke-virtual {v0}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method public final i()V
    .locals 1

    iget-object v0, p0, Lcom/ninesky/a/a/d;->c:Lcom/ninesky/a/a/b;

    invoke-virtual {v0}, Lcom/ninesky/a/a/b;->a()V

    return-void
.end method
